#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTextCharFormat>
#include <QKeyEvent>

class QUdpSocket;

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT
    
public:

    explicit Widget(QWidget *parent,QString usrname);
    ~Widget();
protected:
    bool saveFile(const QString& filename);

    void keyPressEvent(QKeyEvent *event);

private:
    Ui::Widget *ui;
    QUdpSocket *udpSocket;

    QString fileName;

private slots:
    void processPendingDatagrams();
    void on_sendBtn_clicked();

    void getFileName(QString);

    void on_saveTBtn_clicked();

};

#endif // WIDGET_H
